Home

Computer science

'

\ufeffGive a single pipeline, using the head and the tail commands to:

a. \ufeffselect lines 5 \ufeffto 10 \ufefffrom a file

b. \ufeffselect second-to-last line (i.e. \ufeffthe line before the last line) \ufefffrom a file

2. [2] \ufeffHow do you display a list of all processes where processes with the same name are grouped together?

3. [2] \ufeffHow do you display the total number of processes started by the root user?

4. [2] \ufeffHow do you list the ordinary files in your current directory that are not user-writable?

5. [2] \ufeffWhat is the significance of this command?

\ufeffgrep -l "`echo \'\\t\'`" *

6. [2] \ufeffAre the following commands equivalent? Briefly explain.

\ufeffgrep "^[^a-z]" \ufefffoo

\ufeffgrep -v "^[a-z]" \ufefffoo

7. [2] \ufeffWrite a command to display all the lines in a given file that end with a ";" \ufeffor a "." \ufeffcharacter.

8. [2] \ufeffWrite a command to change all and in file foo.html to and , \ufeffrespectively

9. [2] \ufeffWrite a command to delete all leading and trailing spaces in all lines of foo.

10. [2] \ufeffWrite a command to use sed to print all lines in foo that beginning and ending with a dot

'

Answer